﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using P2P.Network.SocketServer;
using Newtonsoft.Json;
using System.Net.Sockets;
using P2P.Network;
using System.Net;

namespace P2P.Main.Model
{
    public class SharedModel
    {
        public string AESKey { get; set; }

        public int KBucketCount { get; set; }

        public int KBucketCapacity { get; set; }

        public Hosts Hosts { get; set; }

        private static readonly object _lock = new object();

        private static SharedModel? _instance;

        private SharedModel()
        {
           
        }

        public static SharedModel Instance
        {
            get 
            {
                if (_instance == null)
                {
                    lock (_lock)
                    {
                        if (_instance == null)
                        {
                            _instance = new SharedModel();
                        }
                    }
                }
                return _instance;
            }
        }
    }
}
